// /////////////////////////////////////////////////////////////////////////////
//
// Name:            AIFrame.h
// Author:          Michael Bartsch
//
// Desc :           The interface for the CAIFrame class.
//
// License:         Copyright (C) 2008-2009 Michael Bartsch
//
//                  This program is free software: you can redistribute it
//                  and/or modify it under the terms of the GNU General Public
//                  License as published by the Free Software Foundation,
//                  either version 3 of the License, or (at your option) any
//                  later version.
//
//                  This program is distributed in the hope that it will be
//                  useful, but WITHOUT ANY WARRANTY; without even the implied
//                  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
//                  PURPOSE. See the GNU General Public License for more
//                  details.
//
//                  You should have received a copy of the GNU General Public
//                  License along with this program. If not, see
//                  <http://www.gnu.org/licenses/>.
//
// /////////////////////////////////////////////////////////////////////////////

#ifndef __C_AIFRAME_H_INCLUDED__
#define __C_AIFRAME_H_INCLUDED__

// Include required header file(s).
#include "../../App.h"
#include "../MainFrame.h"
#include "./AIPanel.h"


// Forward Declarations.
class CMainFrame;
class CAIPanel;
class CAICore;


// Enumerations.
//! Widget ID's
enum AIF_WidgetIDs
{
    AIF_Close = 400,
    AIF_TB_State,
    AIF_StateBox,
    AIF_StartX,
    AIF_StartY,
    AIF_EnableTarget,
    AIF_TargetX,
    AIF_TargetY
};


// The CAIFrame class.
//! The AI Control which can be used to communicate with the
//! integrated Artificial Intelligent Core.
class CAIFrame : public wxFrame
{
public:

    //! Constructor
    //! @param parent The window parent.
    CAIFrame(wxWindow *parent);

    void update();

    //! Handles the close event.
    void onClose(wxCloseEvent &event);

    //! Handles the "Reset" event of the "File" menu.
    void onReset(wxCommandEvent &event);

    //! Handles the "Quit" event of the "File" menu.
    void onQuit(wxCommandEvent &event);

    //! Handles events of the state selector.
    void onStateSelector(wxCommandEvent &event);

    //! Handles events of the agent state selector.
    void onAgentState(wxCommandEvent &event);
    //! Handles events of the start X selector.
    void onStartX(wxSpinEvent &event);
    //! Handles events of the start Y selector.
    void onStartY(wxSpinEvent &event);
    //! Handles events of the target trigger.
    void onEnableTarget(wxCommandEvent &event);
    //! Handles events of the target X selector.
    void onTargetX(wxSpinEvent &event);
    //! Handles events of the target Y selector.
    void onTargetY(wxSpinEvent &event);


private:

    // Internal
    CMainFrame *frameParent;
    CAICore *pAICore;

    // wxWidgets
    wxAuiManager frameManager;

    CAIPanel *aiPane;

    wxRadioBox *stateBox;
    wxSpinCtrl *startX, *startY;
    wxSpinCtrl *targetX, *targetY;
    wxCheckBox *enableTarget;

    DECLARE_EVENT_TABLE()
};

#endif

